SOLinger


C Specification

#include <dolphin/socket.h>
typedef struct SOLinger
{
    int onoff;  // zero = off, nonzero = on
    int linger; // linger time in seconds
} SOLinger;

Description

SOLinger socket option controls the behavior of the SOClose() function for the SO_SOCK_STREAM (TCP) socket:

SOLinger Description
onoff = 0 (default) SOClose() returns as quickly as possible and all data is transmitted in the background.
onoff = 1
linger = 0
SOClose() returns immediately and the current connection is aborted.
onoff = 1
linger != 0
SOClose() blocks until all data is transmitted for up to the specified linger time.

See Also

SOClose(), SOGetSockOpt(), SOSetSockOpt()